<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('训练包选择')"/>
    <th:block th:include="include :: select2-css"/>
    <style>
        .popover-show{
            cursor: pointer;
        }
    </style>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="col-sm-12 search-collapse">
        <form id="data-form">
            <input id="childCourseId" name="childCourseId" th:value="*{childCourseId}" hidden="true">
        </form>
    </div>
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" class="table-hover"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    var prefix = ctx + "business/prepareClass";
    $(function () {
        var options = {
            url: prefix + "/childInfo",
            modalName: "数据",
            toolbar:false,
            columns: [
                {
                    field: 'childId',
                    title: '学生编号',
                    visible: false
                },
                {
                    field: 'childName',
                    title: '姓名',
                },
                {
                    field: 'age',
                    title: '年龄'

                },
                {
                    field: 'grade',
                    title: '年级',
                    formatter: function (value, row, index) {
                        var action='';
                        if(value==0){action="学前"};
                        if(value==1){action="一年级"};
                        if(value==2){action="二年级"};
                        if(value==3){action="三年级"};
                        if(value==4){action="四年级"};
                        if(value==5){action="五年级"};
                        if(value==6){action="六年级"};
                        if(value==7){action="七年级"};
                        if(value==8){action="八年级"};
                        if(value==9){action="九年级"};
                        return action;
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="learningReport(\'' + row.childId + '\',\'' + row.childName + '\')"><i class="fa fa-edit"></i>测评记录</a> ');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });

    function learningReport(childId,childName) {
        var url = ctx + "business/learningReport/learningReport/" + childId;
        $.modal.openTab(childName + "的测评记录", url, 1200, null, null);
    }

</script>
</body>

</html>